package com.starry.crawler_shop.controller;

import com.starry.crawler_shop.entity.Product;
import com.starry.crawler_shop.service.ProductService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (Product)表控制层
 *
 * @author Chao
 * @since 2021-04-19 15:46:56
 */
@RestController
@RequestMapping("product")
public class ProductController {
	/**
	 * 服务对象
	 */
	@Resource
	private ProductService productService;

	/**
	 * 通过主键查询单条数据
	 *
	 * @param id 主键
	 * @return 单条数据
	 */
	@GetMapping("selectOne")
	public Product selectOne(Integer id) {
		return this.productService.queryById(id);
	}

}
